<template>
  <div style="background-color: white;margin-left: 20px;">
    <!-- 查询框 -->
    <div class="search-wrapper">
      <el-collapse accordion v-model="activeName">
        <el-collapse-item title="查询条件" name="1">
          <el-form ref="form" :model="searchParams" label-width="100px" class="queryForm" :inline="true" size="mini">
            <el-form-item label="开票日期" prop="entryDateRange">
              <el-date-picker :clearable="false" v-model="searchParams.entryDateRange" type="daterange" align="right"
                :unlink-panels="true" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
                value-format="yyyy-MM-dd" :picker-options="pickerOptions"></el-date-picker>
            </el-form-item>
            <el-form-item label="发票号码">
              <el-row>
                <el-col :span="11"><el-input placeholder="请输入发票号码起" v-model="searchParams.invNrq" :clearable="true"
                    :maxlength="30" onkeyup="value=value.replace(/[^\d]/g,'')">
                  </el-input></el-col>
                <el-col :span="2">&nbsp;&nbsp;&nbsp;--</el-col>
                <el-col :span="11"><el-input placeholder="请输入发票号码止" v-model="searchParams.invNrz" :clearable="true"
                    :maxlength="30" onkeyup="value=value.replace(/[^\d]/g,'')">
                  </el-input></el-col>
              </el-row>
            </el-form-item>
            <el-form-item label="发票状态">
              <el-select v-model="searchParams.invstatus" placeholder="全部" :clearable="true">
                <el-option label="正常" value="0"></el-option>
                <el-option label="作废" value="1"></el-option>
                <el-option label="红冲" value="2"></el-option>
                <el-option label="部分红冲" value="3"></el-option>
                <el-option label="全额红冲" value="4"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="供应商名称">
              <el-input placeholder="请输入供应商名称" v-model="searchParams.supplierName" :clearable="true" :maxlength="200">
              </el-input>
            </el-form-item>
            <el-form-item label="是否自动勾选">
              <el-select v-model="searchParams.autoCheck" placeholder="全部" :clearable="true">
                <el-option label="不可勾选" value="0"></el-option>
                <el-option label="可勾选" value="1"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="是否匹配">
              <el-select v-model="searchParams.matchStatus" placeholder="全部" :clearable="true">
                <el-option label="未匹配" value="0"></el-option>
                <el-option label="已匹配" value="1"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" size="mini" @click="searchFn()">查询</el-button>
              <el-button type="warning" @click="reset" size="mini" plain>重置</el-button>
            </el-form-item>
          </el-form>

        </el-collapse-item>
      </el-collapse>
    </div>

    <!-- 按钮组件 -->
    <div class="btns">
      <el-button type="primary" @click="deductionInfoShow()" size="small">自动勾选</el-button>
      <span style="margin-left:20px;font-size: 12 px;font-weight: bolder;">
        当前税款所属期：<span>{{ this.skssq }}</span>
        <el-tooltip class="item" effect="dark" content="刷新税款所属期" placement="top-start">
          <el-button type="text" @click="refreshSkssq()" icon="el-icon-refresh" class="pointerCss"
            style=""></el-button>(勾选截止：)
        </el-tooltip>
      </span>
    </div>
    <el-table :header-cell-style="{ background: '#F0F1F3', }" :data="tableData" ref="singleTable" highlight-current-row
      header-align="center" align="center">
      <el-table-column label="序号" type="index" width="50" />
      <el-table-column width="55" key="invType" prop="invType" header-align="center" align="center"
        :show-overflow-tooltip="true">
        <template slot="header">
          <allType-dialog></allType-dialog>
        </template>
        <template slot-scope="scope">
          <div v-if="scope.row.invType == '04' || scope.row.invType == '2'"><el-tag
              size="mini">&nbsp;&nbsp;纸普&nbsp;&nbsp;</el-tag></div>
          <div v-if="scope.row.invType == '01' || scope.row.invType == '0'"><el-tag type="warning"
              size="mini">&nbsp;&nbsp;纸专&nbsp;&nbsp;</el-tag></div>
          <div v-if="scope.row.invType == '10' || scope.row.invType == '51'"><el-tag type="success"
              size="mini">&nbsp;&nbsp;电普&nbsp;&nbsp;</el-tag></div>
          <div v-if="scope.row.invType == '14'"><el-tag type="info" size="mini">通行费</el-tag></div>
          <div v-if="scope.row.invType == '03' || scope.row.invType == '41'"><el-tag type="warning"
              size="mini">机动车</el-tag>
          </div>
          <div v-if="scope.row.invType == '11' || scope.row.invType == '10103'"><el-tag type="success"
              size="mini">&emsp;卷&emsp;</el-tag></div>
          <div v-if="scope.row.invType == '15' || scope.row.invType == '10105'"><el-tag type="warning"
              size="mini">二手车</el-tag>
          </div>
          <div v-if="scope.row.invType == '81' || scope.row.invType == '62'"><el-tag type="success"
              size="mini">数电专</el-tag>
          </div>
          <div v-if="scope.row.invType == '82' || scope.row.invType == '61'"><el-tag type="danger"
              size="mini">数电普</el-tag>
          </div>
          <div v-if="scope.row.invType == '08' || scope.row.invType == '8'"><el-tag
              size="mini">&nbsp;&nbsp;电专&nbsp;&nbsp;</el-tag></div>
        </template>
      </el-table-column>
      <el-table-column prop="invCode" label="发票代码/发票号码" :show-overflow-tooltip="true" width="162px">
        <template slot-scope="scope">
          <span v-if="scope.row.einvNr != '' && scope.row.einvNr != null">
            <el-button type="text" size="small" title="点击复制" icon="el-icon-document-copy"
              @click="handleCopyLink(scope.row.einvNr)"></el-button>
            <span style="color:#65B9FD; cursor: pointer;" @click="showInfo(scope.row)"> {{ scope.row.einvNr }}</span>
          </span>
          <div v-else>
            <el-button type="text" size="small" title="点击复制" icon="el-icon-document-copy"
              @click="handleCopyLink(scope.row.invCode + ' - ' + scope.row.invNr)"></el-button>
            <span>{{ scope.row.invCode }}</span><br>
            <span style="color:#65B9FD; cursor: pointer;" @click="showInfo(scope.row)">{{ scope.row.invNr }}</span>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="发票状态" key="invstatus" prop="invstatus" header-align="center" align="center"
        :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <div v-if="scope.row.invstatus == '0'" class="submitStatusClass"><el-badge is-dot type="success"
              style="margin-top: 15px; margin-right: 10px"></el-badge>正常</div>
          <div v-else-if="scope.row.invstatus == '1'" class="submitStatusClass"><el-badge is-dot type="primary "
              style="margin-top: 15px; margin-right: 10px"></el-badge>作废</div>
          <div v-else-if="scope.row.invstatus == '2'" class="submitStatusClass"><el-badge is-dot type="danger "
              style="margin-top: 15px; margin-right: 10px"></el-badge>红冲</div>
          <div v-else-if="scope.row.invstatus == '3'" class="submitStatusClass"><el-badge is-dot type="danger "
              style="margin-top: 15px; margin-right: 10px"></el-badge>部分红冲</div>
          <div v-else-if="scope.row.invstatus == '4'" class="submitStatusClass"><el-badge is-dot type="danger "
              style="margin-top: 15px; margin-right: 10px"></el-badge>全额红冲</div>
        </template>
      </el-table-column>
      <el-table-column label="发票日期" prop="invDate" show-overflow-tooltip />
      <el-table-column label="销方名称" prop="sellerName" show-overflow-tooltip />
      <el-table-column label="销方税号" prop="sellerTax" show-overflow-tooltip />
      <el-table-column label="不含税金额" prop="invAmount" show-overflow-tooltip />
      <el-table-column label="税额" prop="taxAmount" show-overflow-tooltip />
      <el-table-column label="原币金额" prop="originAmount" show-overflow-tooltip />
      <el-table-column label="发票备注" prop="memo" show-overflow-tooltip />
      <el-table-column label="匹配状态" prop="matchStatus" show-overflow-tooltip>
        <template slot-scope="scope">
          <div v-if="scope.row.matchStatus != '' && scope.row.matchStatus != null">
            <el-badge is-dot type="success" style="margin-top: 10px; margin-right: 5px"></el-badge>已匹配
          </div>
          <div v-else> <el-badge is-dot type="warning" style="margin-top: 10px; margin-right: 5px"></el-badge>未匹配</div>
        </template>
      </el-table-column>
      <el-table-column label="勾选状态" key="gxzt" prop="gxzt" header-align="left" align="left">
        <template slot-scope="scope">
          <div v-if="scope.row.gxzt == '1'" class="submitStatusClass">
            <el-badge is-dot type="success" style="margin-top: 10px; margin-right: 5px"></el-badge>已勾选<br />
          </div>
          <div v-else class="submitStatusClass">
            <el-badge is-dot type="warning" style="margin-top: 10px; margin-right: 5px"></el-badge>未勾选
          </div>
        </template>
      </el-table-column>
      <el-table-column label="是否自动勾选" prop="autoCheck" show-overflow-tooltip>
        <template slot-scope="scope">
          <div v-if="scope.row.autoCheck == '1'"> <el-badge is-dot type="success"
              style="margin-top: 10px; margin-right: 5px"></el-badge>可勾选
          </div>
          <div v-else><el-badge is-dot type="warning" style="margin-top: 10px; margin-right: 5px"></el-badge>不可勾选</div>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页页码 -->
    <div class="pageClass">
      <el-pagination :small="true" @size-change="handleSizeChange" @current-change="handleCurrentChange"
        :current-page="this.pageParams.pageIndex" :page-sizes="[25, 50, 75, 100]" :page-size="this.pageParams.pageSize"
        layout="total, sizes, prev, pager, next, jumper" :total="this.pageParams.total"></el-pagination>
    </div>
    <toll-dialog ref="tollDialog"></toll-dialog>
    <Einvoice-dialog ref="einvoiceDialog"></Einvoice-dialog>
    <detail-dialog ref="detailDialog"></detail-dialog>
    <car-dialog ref="carDialog"></car-dialog>
    <doc-detail-dialog ref="docDeatilRef"></doc-detail-dialog>
    <el-dialog title="提示" :visible.sync="deductionInfoDialog" width="25%">
      <div style="margin-left:15px;">本次可勾选 <span style="color:red;">{{ this.deductionTotal }}</span> 张发票</div>
      <div style="margin-top:15px;margin-left:15px;">合计金额为: <span style="color:red;">{{ this.deductionHjje }}</span></div>
      <div style="margin-top:15px;margin-left:15px;">合计税额为: <span style="color:red;">{{ this.deductionHjse }}</span></div>
      <div style="margin-top:15px;margin-left:15px;">有效税额为: <span style="color:red;">{{ this.deductionYxse }}</span></div>
      <div style="margin-top:15px;margin-left:15px;">确定提交勾选吗？</div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="deductionInfoDialog = false">取 消</el-button>
        <el-button type="primary" @click="submitDeductionList()">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
//导入模块
import { getInvList, getInvInfo, calcInv, deduction } from '../js/zsdz.js'
import baseSearch from '@/libs/baseSearch.js'
import moment from 'moment'
import allInvType from '@/components/inv-type/allInvType.vue';
import tollInvDetaildialog from '@/components/invoiceStyle/tollInvDetaildialog.vue';
import allECInvDetaildialog from '@/components/invoiceStyle/allECInvDetaildialog.vue';
import detaildialog from '@/components/invoiceStyle/detaildialog.vue';
import carDetaildialog from '@/components/invoiceStyle/carDetaildialog.vue';
import docDetailDialog from '../dialog/docDetail.vue'
import { convertCurrency } from "@/libs/tools.js";
import { getSkssq } from "@/api/income/incomeInfo.js";
export default {
  name: 'zsInvoice',
  components: {
    'allType-dialog': allInvType,
    'toll-dialog': tollInvDetaildialog,
    'Einvoice-dialog': allECInvDetaildialog,
    'detail-dialog': detaildialog,
    'car-dialog': carDetaildialog,
    'doc-detail-dialog': docDetailDialog
  },
  data() {
    return {
      activeName: '1',
      pickerOptions: baseSearch.pickerOptions,
      // 表格数据
      tableData: [],
      // 表格分页数据
      pageParams: {
        pageIndex: 1,
        pageSize: 25,
        total: 0,
      },
      searchParams: {
        entryDateRange: [moment(new Date()).format("YYYY-MM") + "-01", moment(new Date()).format("YYYY-MM-DD")],
        kprqq: '',
        kprqz: '',
        invNrq: '',
        invNrz: '',
        supplierName: '',
        matchStatus: '',
        gxzt: '',
        invstatus: '',
        pageSize: 25,
        pageIndex: 1,
      },
      skssq: '',
      deductionInfoDialog: false,
      deductionTotal: 0,
      deductionHjje: 0,
      deductionHjse: 0,
      deductionYxse: 0,
      deductionList: [],
    }
  },
  created() {
    this.getSkssq()
    this.searchFn()
  },
  //方法区
  methods: {
    /**
       * 查询功能
       */
    searchFn() {
      this.searchParams.pageIndex = 1
      var entryDate = this.searchParams.entryDateRange;
      if (entryDate != null && entryDate != "") {
        this.searchParams.kprqq = entryDate[0] + ' 00:00:00';
        this.searchParams.kprqz = entryDate[1] + ' 23:59:59';
      } else {
        this.searchParams.kprqq = "";
        this.searchParams.kprqz = "";
      }
      this.initTableData()
    },
    // 查询重置功能
    reset() {
      this.searchParams = {
        entryDateRange: [moment(new Date()).format("YYYY-MM") + "-01", moment(new Date()).format("YYYY-MM-DD")],
        kprqq: '',
        kprqz: '',
        invNrq: '',
        invNrz: '',
        supplierName: '',
        matchStatus: '',
        gxzt: '',
        autoCheck: '',
        pageSize: 25,
        pageIndex: 1,
      }
    },
    initTableData() {
      getInvList(this.searchParams).then((res) => {
        if (res.code == 0) {
          this.tableData = res.data.rows
          this.pageParams.total = Number(res.data.total)
          if (this.pageParams.total == 0) {
            this.$message({
              message: "暂无数据",
              type: 'success',
            })
          }
        } else if (res.code != 0) {
          this.$message({
            message: res.message,
            type: 'warning',
          })
        }
      })
    },
    //发票详情
    showInfo(row) {
      if (row.matchStatus != '' && row.matchStatus != null) {//已匹配
        this.$refs.docDeatilRef.invData = row
        this.$refs.docDeatilRef.detailvisible = true
        return
      }
      var param = {}
      param.invcode = row.invCode
      param.invnr = row.invNr
      param.eInvnr = row.einvNr
      getInvInfo(param).then((res) => {
        if (res.code == 0) {
          row = res.data
          if (row.invkind == '14') {
            this.$refs.tollDialog.invoiceForm.invcode = row.invcode
            this.$refs.tollDialog.invoiceForm.invnr = row.invnr
            this.$refs.tollDialog.invoiceForm.invdate = row.invdate
            this.$refs.tollDialog.invoiceForm.custname = row.custname
            this.$refs.tollDialog.invoiceForm.custtaxnr = row.custtaxnr
            this.$refs.tollDialog.invoiceForm.sellername = row.sellername
            this.$refs.tollDialog.invoiceForm.sellertaxnr = row.sellertaxnr
            this.$refs.tollDialog.invoiceForm.totalamount = row.totalamount
            if (row.totalamount.toString().indexOf("-") != -1) {
              this.$refs.tollDialog.invoiceForm.totalamountDX = "(负数)" + convertCurrency(row.totalamount.substring(1))
            } else {
              this.$refs.tollDialog.invoiceForm.totalamountDX = convertCurrency(row.totalamount)
            }
            this.$refs.tollDialog.invoiceForm.detailsList = row.list
            this.$refs.tollDialog.detailDialogVisible = true
          } else if (row.invkind == '81' || row.invkind == '82') {
            this.$refs.einvoiceDialog.invoiceForm.invnr = row.einvnr
            this.$refs.einvoiceDialog.invoiceForm.invdate = row.invdate
            this.$refs.einvoiceDialog.invoiceForm.custname = row.custname
            this.$refs.einvoiceDialog.invoiceForm.custtaxnr = row.custtaxnr
            this.$refs.einvoiceDialog.invoiceForm.sellername = row.sellername
            this.$refs.einvoiceDialog.invoiceForm.sellertaxnr = row.sellertaxnr
            this.$refs.einvoiceDialog.invoiceForm.totalamount = row.totalamount
            this.$refs.einvoiceDialog.invoiceForm.memo = row.memo
            if (row.totalamount.toString().indexOf("-") != -1) {
              this.$refs.einvoiceDialog.invoiceForm.totalamountDX = "(负数)" + convertCurrency(row.totalamount.substring(1))
            } else {
              this.$refs.einvoiceDialog.invoiceForm.totalamountDX = convertCurrency(row.totalamount)
            }
            this.$refs.einvoiceDialog.invoiceForm.detailsList = row.list
            if (row.invkind == '62' || row.invkind == '81') {
              this.$refs.einvoiceDialog.invoiceTitle = "电子发票（增值税专用发票）"
            } else {
              this.$refs.einvoiceDialog.invoiceTitle = "电子发票（普通发票）"
            }
            this.$refs.einvoiceDialog.detailDialogVisible = true
          } else if (row.invkind == '41') {
            this.$refs.carDialog.invoiceTitle = "机动车销售统一发票"
            this.$refs.carDialog.invoiceForm.invdate = moment(row.invdate).format('YYYY-MM-DD')
            this.$refs.carDialog.invoiceForm.invcode = row.invcode
            this.$refs.carDialog.invoiceForm.invnr = row.invnr
            this.$refs.carDialog.invoiceForm.certificate = row.invoiceCar.certificate
            this.$refs.carDialog.invoiceForm.certificateimport = row.invoiceCar.certificateimport
            this.$refs.carDialog.invoiceForm.idNo = row.invoiceCar.custidnr
            this.$refs.carDialog.invoiceForm.custname = row.invoiceCar.custname
            this.$refs.carDialog.invoiceForm.custtaxnr = row.invoiceCar.custtaxnr
            this.$refs.carDialog.invoiceForm.issuer = row.invoiceCar.drawer
            this.$refs.carDialog.invoiceForm.enginenr = row.invoiceCar.enginenr
            this.$refs.carDialog.invoiceForm.factorymodel = row.invoiceCar.factorymodel
            this.$refs.carDialog.invoiceForm.inspectionnr = row.invoiceCar.inspectionnr
            this.$refs.carDialog.invoiceForm.invamount = row.invoiceCar.invamount
            this.$refs.carDialog.invoiceForm.limitpeople = row.invoiceCar.limitpeople
            this.$refs.carDialog.invoiceForm.machineno = row.invoiceCar.machineno
            this.$refs.carDialog.invoiceForm.productplace = row.invoiceCar.productplace
            this.$refs.carDialog.invoiceForm.salerAddress = row.invoiceCar.salerAddress
            this.$refs.carDialog.invoiceForm.salerBankAccount = row.invoiceCar.salerBankAccount
            this.$refs.carDialog.invoiceForm.salerBankName = row.invoiceCar.salerBankName
            this.$refs.carDialog.invoiceForm.salerPhone = row.invoiceCar.salerPhone
            this.$refs.carDialog.invoiceForm.sallername = row.invoiceCar.sallername
            this.$refs.carDialog.invoiceForm.sallertaxnr = row.invoiceCar.sallertaxnr
            this.$refs.carDialog.invoiceForm.taxamount = row.invoiceCar.taxamount
            this.$refs.carDialog.invoiceForm.taxrate = row.invoiceCar.taxrate
            this.$refs.carDialog.invoiceForm.taxbureaucode = row.invoiceCar.taxbureaucode
            this.$refs.carDialog.invoiceForm.taxbureauname = row.invoiceCar.taxbureauname
            this.$refs.carDialog.invoiceForm.taxrecords = row.invoiceCar.taxrecords
            this.$refs.carDialog.invoiceForm.tonnage = row.invoiceCar.tonnage
            this.$refs.carDialog.invoiceForm.totalamount = row.invoiceCar.totalamount
            this.$refs.carDialog.invoiceForm.totalamountDX = convertCurrency(row.invoiceCar.totalamount)
            this.$refs.carDialog.invoiceForm.vehiclenr = row.invoiceCar.vehiclenr
            this.$refs.carDialog.invoiceForm.vehicletype = row.invoiceCar.vehicletype
            this.$refs.carDialog.detailDialogVisible = true
          } else {
            if (row.invkind == '2') {
              this.$refs.detailDialog.invoiceTitle = '增值税普通发票'
            } else if (row.invkind == '0') {
              this.$refs.detailDialog.invoiceTitle = '增值税专用发票'
            } else if (row.invkind == '51') {
              this.$refs.detailDialog.invoiceTitle = '增值税电子普通发票'
            } else if (row.invkind == '8') {
              this.$refs.detailDialog.invoiceTitle = '增值税电子专用发票'
            }
            this.$refs.detailDialog.invoiceForm.invcode = row.invcode
            this.$refs.detailDialog.invoiceForm.invnr = row.invnr
            this.$refs.detailDialog.invoiceForm.invdate = row.invdate
            this.$refs.detailDialog.invoiceForm.custname = row.custname
            this.$refs.detailDialog.invoiceForm.custtaxnr = row.custtaxnr
            this.$refs.detailDialog.invoiceForm.custaddrtel = row.custaddrtel
            this.$refs.detailDialog.invoiceForm.custbankacct = row.custbankacct
            this.$refs.detailDialog.invoiceForm.selleraddresstel = row.selleraddresstel
            this.$refs.detailDialog.invoiceForm.sellerbankacct = row.sellerbankacct
            this.$refs.detailDialog.invoiceForm.sellername = row.sellername
            this.$refs.detailDialog.invoiceForm.sellertaxnr = row.sellertaxnr
            this.$refs.detailDialog.invoiceForm.totalamount = row.totalamount
            this.$refs.detailDialog.invoiceForm.memo = row.memo
            this.$refs.detailDialog.invoiceForm.payee = row.payee
            this.$refs.detailDialog.invoiceForm.checker = row.checker
            this.$refs.detailDialog.invoiceForm.issuer = row.issuer
            if (row.totalamount.toString().indexOf("-") != -1) {
              this.$refs.detailDialog.invoiceForm.totalamountDX = "(负数)" + convertCurrency(row.totalamount.substring(1))
            } else {
              this.$refs.detailDialog.invoiceForm.totalamountDX = convertCurrency(row.totalamount)
            }
            this.$refs.detailDialog.invoiceForm.detailsList = row.list
            this.$refs.detailDialog.detailDialogVisible = true
          }
        } else if (res.code != 0) {
          this.$message({
            message: res.message,
            type: 'warning',
          })
        }
      })
    },
    //刷新税款所属期
    refreshSkssq() {
      this.getSkssq()
    },
    getSkssq() {
      let params = {
        nsrsbh: ''
      }
      getSkssq(params).then((res) => {
        if (res.data.code != '200') {
          if (res.data.message == null) {
            this.$message({
              message: "税款所属期获取失败，接口返回为空",
              type: "warning",
            });
          } else {
            this.$message({
              message: res.data.message,
              type: "warning",
            });
          }
        } else {
          if (res.data == null) {
            this.$message({
              message: "税款所属期获取失败，接口返回为空",
              type: "warning",
            });
          } else {
            this.skssq = res.data.skssq
          }
        }
      });
    },
    //自动勾选
    deductionInfoShow() {
      calcInv().then((res) => {
        if (res.code == 0) {
          this.deductionTotal = res.data.total
          if (this.deductionTotal == 0) {
            this.$message({
              message: "暂无可抵扣发票数据，请核实",
              type: 'success',
            })
            return
          }
          this.deductionHjje = res.data.totalje
          this.deductionHjse = res.data.totalse
          this.deductionYxse = res.data.totalse
          this.deductionList = res.data.deductionList
          this.deductionInfoDialog = true
        } else if (res.code != 0) {
          this.$message({
            message: res.message,
            type: 'warning',
          })
        }
      })
    },
    submitDeductionList() {
      deduction(this.deductionList).then((res) => {
        if (res.data.code == '000') {
          this.$message({
            message: res.data.message,
            type: "success",
          });
        } else {
          this.$message({
            message: res.data.message,
            type: "warning",
          });
        }
        this.deductionInfoDialog = false
        this.initTableData()
      });
    },

    ////分页
    handleSizeChange(val) {
      this.searchParams.pageSize = val
      this.initTableData()
    },
    handleCurrentChange(val) {
      this.searchParams.pageIndex = val
      this.initTableData()
    },

    handleCopyLink(val) {
      let _this = this
      this.$copyText(val).then(
        function (e) {
          _this.$message({
            showClose: true,
            message: '复制成功',
            type: 'success',
          })
        },
        function (e) {
          _this.$message({
            showClose: true,
            message: '复制失败，请手动复制',
            type: 'error',
          })
        }
      )
    },
  },
}
</script>
<style scoped>
.search-wrapper {
  text-align: left;
  box-shadow: 2px 2px 4px 2px rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
  margin-bottom: 25px;
}

.search-wrapper ::v-deep .el-collapse-item__content {
  padding-bottom: 0px !important;
}

.search-wrapper ::v-deep .el-collapse-item__header {
  padding-left: 15px !important;
}

.el-icon-warning {
  color: #f56c6c;
  font-size: 15px;
  margin-left: 12px;
}

.el-col {
  height: auto;
}
</style>